package dao;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * Created by aceyin on 2015/6/1 0001.
 */
public interface GenericDao<ENTITY, ID extends Serializable> {
    void insert(ENTITY entity);

    int update(ENTITY entity);

    int delete(ID id);

    int delete(Map<String, Object> param);

    int count();

    int count(Map<String, Object> param);

    int count(String sqlId, Map<String, Object> params);

    ENTITY get(ID id);

    List<ENTITY> list(int page, int rownum);

    List<ENTITY> list(Map<String, Object> param);

    void batchInsert(final List<ENTITY> list);

    void batchUpdate(final List<ENTITY> list);

    void batchDelete(final List<ID> list);
}
